//
//  CheckEditDetailFirstCell.m
//  ICrEAM
//
//  Created by mac on 16/11/11.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "CheckEditDetailFirstCell.h"
@interface CheckEditDetailFirstCell(){
    NSString *_outDistance;
}

@property (weak, nonatomic) IBOutlet UILabel *inTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *outTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *licenceTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *serviceTitleLabel;

@end
@implementation CheckEditDetailFirstCell
+(instancetype)createCheckEditDetailFirstCell{
    return [[[NSBundle mainBundle]loadNibNamed:@"CheckEditDetailFirstCell" owner:nil options:nil]lastObject];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle=UITableViewCellSelectionStyleNone;
    if (![ICrEAMTool isVW]) {
        self.inTitleLabel.textColor=KSKTextTitleColor;
        self.outTitleLabel.textColor=KSKTextTitleColor;
        self.licenceTitleLabel.textColor=KSKTextTitleColor;
        self.serviceTitleLabel.textColor=KSKTextTitleColor;
    }
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
-(void)loadPushInDistance:(NSString *)pushInDistance getCarDistance:(NSString*)outDistance license:(NSString *)license serviceName:(NSString *)name{
    self.pushInDistanceText.text=pushInDistance;
    self.outDistanceText.text=outDistance;
    self.licenseText.text=license;
    self.serviceNameText.text=name;
    _outDistance=outDistance;
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    if (self.textReturnBlock) {
       NSString *result=[textField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
        self.textReturnBlock([result isEqualToString:_outDistance]);
    }
    return YES;
}
-(BOOL)textFieldShouldEndEditing:(UITextField *)textField{
     NSString *result=[textField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
    BOOL isequal=[result isEqualToString:_outDistance];
    if (self.textReturnBlock) {
       
        self.textReturnBlock(isequal);
    }
    return YES;
}
//- (void)textFieldDidEndEditing:(UITextField *)textField{
//    if (self.textReturnBlock) {
//        NSString *result=[textField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
//        self.textReturnBlock([result isEqualToString:_outDistance]);
//    }
//}
@end
